<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
        <meta name="description" content="Test on HTML and CSS">
        <meta name="author" content="Huoty">
        <meta http-equiv="refresh" content="30">
        <title>Web 设计</title>
        <link rel="shortcut icon" href="http://konghy.cn/favicon.ico" type="image/x-icon" />
    </head>
    <body>

    </body>
</html>
<script type="text/javascript">
    function httpGetAsync(theUrl, callback)
    {
        xmlHttp = null;
        if (window.XMLHttpRequest)
        {// code for IE7, Firefox, Opera, etc.
            xmlHttp = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {// code for IE6, IE5
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        if (xmlHttp != null)
        {
            xmlHttp.onreadystatechange = function() {
                if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
                {
                    callback(xmlHttp.responseText);
                }
                else
                {
                    console.error("Problem retrieving XML data");
                }
            }
            xmlHttp.open("GET", theUrl, true); // true for asynchronous
            xmlHttp.setRequestHeader('Access-Control-Allow-Origin', '*');
            xmlHttp.send(null);
        }
        else
        {
            console.error("Your browser does not support XMLHTTP.");
        }
    }

    function showIcibaDS(ds_data)
    {
        // show daily sentence
        // 跨域请求参考：http://www.jb51.net/article/75669.htm
        content = ds_data.content;
        note = ds_data.note;
        document.write(content + '<br>');
        document.write(note);

    }

    // httpGetAsync("http://open.iciba.com/dsapi/", showIcibaDS);
</script>
<script type="text/javascript" src="http://open.iciba.com/dsapi/?callback=showIcibaDS"></script>
